home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / misc / amag / sh9301c.lha / Windows(S.106) / Listing1.txt next >
Text File  |  1992-11-20  |  2KB  |  80 lines

  1. #include <exec/types.h>
  2. #include <intuition/intuition.h>
  3.  
  4. struct IntuitionBase *IntuitionBase;
  5. struct GfxBase *GfxBase;
  6.  
  7. /*  Struktur für neues Window initialisieren:  */
  8. struct NewWindow NewWindow =
  9. {
  10.    170,80,              /* linke obere Ecke    */
  11.    300,100,             /* Breite u. Höhe      */
  12.    -1,-1,               /* Farbe der Pens      */
  13.    CLOSEWINDOW,         /* Meldung wenn        */
  14.  
  15.    WINDOWCLOSE   |      /* Window-Gadgets      */
  16.    WINDOWSIZING  |
  17.    WINDOWDRAG    |
  18.    WINDOWDEPTH   |
  19.    SMART_REFRESH |      /* Refresh-Art          */
  20.    ACTIVATE,            /* aktiv nach Open()    */
  21.  
  22.    NULL,                /* keine User-Gadgets   */
  23.    NULL,                /* keine User-CheckMark */
  24.    "Mein Window",       /* Window-Titel         */
  25.    0,                   /* Kein eigener Screen  */
  26.    NULL,                /* keine SuperBitmap    */
  27.    100,                 /* Mindestbreite        */
  28.    30,                  /* Mindesthöhe          */
  29.    640,                 /* Maximalbreite        */
  30.    256,                 /* Maximalhöhe          */
  31.    WBENCHSCREEN         /* Bildschirmtyp        */
  32. };
  33.  
  34. main()
  35. {
  36.    struct Window *Window;
  37.    struct RastPort *rp;
  38.  
  39.    /* Zwei Libraries öffnen, bei Fehler Exit: */
  40.    IntuitionBase =
  41.    (struct IntuitionBase *) OpenLibrary("intuition.library",0L);
  42.    if (IntuitionBase == NULL)  exit(FALSE);
  43.  
  44.    GfxBase =
  45.    (struct GfxBase *) OpenLibrary("graphics.library",0L);
  46.    if (GfxBase == NULL)
  47.    {
  48.       CloseLibrary(IntuitionBase);
  49.       exit(FALSE);
  50.    }
  51.  
  52.    /* Window öffnen, bei Fehler Exit: */
  53.    Window =
  54.    (struct Window *) OpenWindow(&NewWindow);
  55.  
  56.    if (Window == NULL)
  57.    {
  58.       CloseLibrary(GfxBase);
  59.       CloseLibrary(IntuitionBase);
  60.       exit(FALSE);
  61.    }
  62.  
  63.    /* Rastport beschaffen und Text ausgeben:      */
  64.    rp = Window->RPort;           /* Der Rastport  */
  65.    SetAPen(rp, 1L);              /* Farbe weiß    */
  66.    Move(rp, 100, 50);            /* Cursor -> x,y */
  67.    Text(rp, "Hallo Welt!",11L);  /* Text zeichnen */
  68.  
  69.    /* Auf Message warten,
  70.       kann hier hier nur Close sein: */
  71.    Wait(1L << Window->UserPort->mp_SigBit);
  72.  
  73.    CloseWindow(Window);        /* Alles schließen */
  74.    CloseLibrary(GfxBase);
  75.    CloseLibrary(IntuitionBase);
  76.  
  77.    exit(TRUE);                 /*   und Ende      */
  78. }
  79.  
  80.